package com.example.mp.bean;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serializable;

/**
 * @auther liujb
 * @date 2021/7/24-21:38
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
// 排除dept，
@ToString(exclude = "dept")
@TableName(value = "tbl_employee")
public class Employee extends Model<Employee> implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    private Integer id;

    // 插入为空时自动填充
    @TableField(fill = FieldFill.INSERT)
    private String lastName;
    private String email;
    private Integer gender;

    private Integer dId;

    // 乐观锁,加上版本控制
    @Version
    private Integer version;

    // 逻辑删除
    @TableLogic
    private Integer delFlag;

    // dept不是数据库字段
    @TableField(exist = false)
    private Department dept;


}
